package rest.jbpm.wrappers.lists;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import rest.jbpm.wrappers.HistoryTask;
import rest.jbpm.wrappers.Job;

@XmlRootElement
@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlType(name = "jobs", propOrder = {
    "jobs"})
public class JobList {

	private List<Job> jobs;
	private String baseUri;
	
	protected JobList() {
		
	}
	
	public JobList(Collection<? extends org.jbpm.api.job.Job> jbs, String baseUri) {
		
		this.baseUri = baseUri;
		jobs = new ArrayList<Job>();
		
		for(org.jbpm.api.job.Job jb : jbs)
			jobs.add(new Job(jb,baseUri));

	}
	
	@XmlElement(name="job",required=true)
	public List<Job> getJobs() {
		return jobs;
	}
}

